package com.example.goodsass.constans.enums;

import lombok.Getter;

@Getter
public enum UploadType {

    /**
     *  用户头像
     */
    USER_AVATAR("1","userAvatar", "用户头像"),

    /**
     * 帖子附件
     */
    POST_ATTACHMENT("2","postAttachment", "帖子附件"),

    /**
     * 用户音乐
     */
    USER_MUSIC("3","userMusic", "用户音乐");

    private final String code;

    private final String value;

    private final String desc;

    UploadType(String code, String value, String desc) {
        this.code = code;
        this.value = value;
        this.desc = desc;
    }

    public static UploadType getByCode(String code) {
        for (UploadType uploadType : values()) {
            if (uploadType.getCode().equals(code)) {
                return uploadType;
            }
        }
        return null;
    }

}
